package com.yksj.healthtalk.ui.doctor;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;

import com.yksj.healthtalk.comm.BaseFragmentActivity;
import com.yksj.healthtalk.ui.R;
import com.yksj.healthtalk.utils.SystemUtils;
import com.yksj.healthtalk.utils.ToastUtil;

/**
 * 医生精确查找
 * @author Administrator
 *
 */
public class DoctorExactSearchActivity extends BaseFragmentActivity implements OnClickListener{
	
	private EditText mEditText;//输入框

	@Override
	protected void onCreate(Bundle arg0) {
		// TODO Auto-generated method stub
		super.onCreate(arg0);
		setContentView(R.layout.doctor_exact_search);
		initWidget();
	}


	private void initWidget() {
		initTitle();
		mEditText = (EditText)findViewById(R.id.et);
		titleRightBtn2.setVisibility(View.VISIBLE);
		titleRightBtn2.setText(R.string.sure);
		titleTextV.setText("精确查找");
		titleLeftBtn.setOnClickListener(this);
		titleRightBtn2.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.title_back:
			onBackPressed();
			break;
		case R.id.title_right2:
			sumit();
			break;
		}
	}
	
	
	private void sumit(){
		SystemUtils.hideSoftBord(getApplicationContext(), mEditText);
		if (!TextUtils.isEmpty(mEditText.getText().toString())) {
			Intent  intent = new Intent(getApplicationContext(), DoctorSearchResultActivity.class);
			//三甲医院的专家列表的精确搜索
			if (getIntent().hasExtra("merchantid")) {
				intent.putExtra("merchantid", getIntent().getStringExtra("merchantid"));
			}
			intent.putExtra("result", mEditText.getText().toString());
			startActivity(intent);
		}else {
			ToastUtil.showShort(getApplicationContext(), "输入不能为空");
		}
	}
	
	

}
